package com.econ.powercloud.ems.service.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.econ.powercloud.ems.dal.entity.EmsPriceModel;
import com.econ.powercloud.ems.dal.mapper.EmsPriceModelMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class EmsPriceModelDAO extends ServiceImpl<EmsPriceModelMapper, EmsPriceModel> {

    public Page<EmsPriceModel> selectPageByProvince(Integer province,Integer pageNo, Integer pageSize){
        LambdaQueryWrapper<EmsPriceModel> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(province != null, EmsPriceModel::getProvince,province);
        Page<EmsPriceModel> page = new Page<>(pageNo, pageSize);
        return this.baseMapper.selectPage(page,wrapper);
    }
}
